<{include file='customer/head.html'}>
<body>
	<div>
<{if $pmsuserinfo.isitadministrator==1 || $pmsuserinfo.powerlist & 1}>
		<input type="button" class="userProjectRecord" value="添加">
<{/if}>
		
	</div>
	<div>
		<span>项目:</span>
			<select class="prjid">
			<option value="-1">全部</option>	
			<{foreach $prolist as $k=>$v}>
			<option value="<{$v.id}>"><{$v.name}></option>
			<{/foreach}>
			</select>
		<span>客户:</span>
			<select class="customer_id">
			<option value="-1">全部</option>	
			<{foreach $custlist as $k=>$v}>
			<option value="<{$v.id}>"><{$v.name}></option>
			<{/foreach}>
			</select>
		<span>项目状态:</span>
			<select class="prjstaus">
			<option value="-1">全部</option>	
			<option value="0">开发中</option>
			<option value="1">已上线</option>
			</select>
		<span>进度状态:</span>
			<select class="status">
			<option value="-1">全部</option>	
			<option value="0">新建</option>
			<option value="1">项目经理已签字</option>
			<option value="19">项目经理打回</option>
			<option value="2">总经理已签字</option>
			<option value="29">项目经理打回</option>
			<option value="3">研发已签字</option>
			<option value="39">研发打回</option>
			<option value="100">完成</option>
			</select>
		<span>是否加急:</span>
			<select class="isquick">
			<option value="-1">全部</option>	
			<option value="0">不加急</option>
			<option value="1">加急</option>
			</select>
	</div>
<table>
	<tr>
		<th>ID</th>
		<th>客户</th>
		<th>项目</th>
		<th>项目状态</th>
		<th>需要时间</th>
		<th>是否加急</th>
		<th>进度状态</th>
		<th>创建用户</th>
		<th>创建时间</th>
		<th>操作</th>
	</tr>
	<tbody class="prorecord_html">
	<{foreach $list as $k=>$v}>
	<tr>
		<td><{$v.id}></td>
		<td><{$v.custmoername}></td>
		<td><{$v.projectname}></td>
		<td><{if $v.prjstaus==1}>已上线<{else}>未上线<{/if}></td>
		<td><{$v.needtime}></td>
		<td><{if $v.isquick==1}>加急<{else}>不加急<{/if}></td>
		<td>
			<{if $v.status==0}>新建
			<{elseif $v.status==1}>项目经理已签字
			<{elseif $v.status==19}>项目经理打回
			<{elseif $v.status==2}>总经理已签字
			<{elseif $v.status==29}>总经理打回
			<{elseif $v.status==3}>研发已签字
			<{elseif $v.status==39}>研发打回
			<{elseif $v.status==100}>完成
			<{else}>未知<{/if}>
		</td>
		<td><{$v.username}></td>
		<td><{$v.addtime|date_format:"%Y-%m-%d %H:%M:%S"}></td>
		<td>
			<input type="button" onclick="ProRecordeDetails('<{$v.id}>')" value="详情">
			<{if $v.status==0}>
				<{if $pmsuserinfo.isitadministrator==1 || $pmsuserinfo.powerlist & 1}>
				<input type="button" onclick="ProRecordeEit('<{$v.id}>')" value="编辑">
				<{/if}>
			
			<{elseif $v.status==1}>
				
			<{elseif $v.status==19}>
				<{if $pmsuserinfo.isitadministrator==1 || $pmsuserinfo.powerlist & 1}>
				<input type="button" onclick="ProRecordeEit('<{$v.id}>')" value="编辑">
				<{/if}>
			<{elseif $v.status==2}>
				
			<{elseif $v.status==29}>
				<{if $pmsuserinfo.isitadministrator==1 || $pmsuserinfo.powerlist & 1}>
				<input type="button" onclick="ProRecordeEit('<{$v.id}>')" value="编辑">
				<{/if}>
			<{elseif $v.status==3}>
				
			<{elseif $v.status==39}>
				<{if $pmsuserinfo.isitadministrator==1 || $pmsuserinfo.powerlist & 1}>
				<input type="button" onclick="ProRecordeEit('<{$v.id}>')" value="编辑">
				<{/if}>
			<{elseif $v.status==100}>
				
			<{/if}>
		</td>
	</tr>
	<{/foreach}>
	</tbody>
</table>
<div class="page">
	<{$pageshow}>
</div>
<script type="text/javascript">
	//审核
	function ProRecordeDetails(id){
		var verifyurl='<{$pmsroot}>/ProjectRecord/projectRecordeDetails?id='+id;
		_hcinits.init(['_layer_admin_min'],function(){
			_layer_admin=_hcinits._layer_admin;
			_layer_admin.open('详情',verifyurl);
		})
	}
	function ProRecordeEit(id){
		var editurl='<{$pmsroot}>/ProjectRecord/projectRecordEdit?id='+id;
		_hcinits.init(['_layer_admin_min'],function(){
			_layer_admin=_hcinits._layer_admin;
			_layer_admin.open('编辑项目状况',editurl);
		})
	}
	function ajaxpage(page){
		_hcinits.init(['_ajaxs_min','_form_min','_layer_admin_min'],function(){
			_ajaxs=_hcinits._ajaxs;
			_layer_admin=_hcinits._layer_admin;
			_form=_hcinits._form;
			var url='';
			url+=_form.geturl('select','.prjid','prjid','-1');
			url+=_form.geturl('select','.customer_id','customer_id','-1');
			url+=_form.geturl('select','.prjstaus','prjstaus','-1');
			url+=_form.geturl('select','.status','status','-1');
			url+=_form.geturl('select','.isquick','isquick','-1');
			url=_form.geturl('url',url);
			if(url!=''){url+='&page='+page;}else{url+='page='+page;}
			_ajaxs.post('/ProjectRecord/projectRecordList',url,function(data){
				if(data.status){
					$('.prorecord_html').html(data.data.html);
					$('.page').html(data.data.pageshow);
				}else{
					_layer_admin.errorMsg(data.message);
				}
			})
		})
	}
	$(function(){
		//添加
		$('.userProjectRecord').click(function(){
			var addurl='<{$pmsroot}>/ProjectRecord/projectRecordAdd';
			_hcinits.init(['_layer_admin_min'],function(){
				_layer_admin=_hcinits._layer_admin;
				_layer_admin.open('添加项目状况',addurl);
			})
		})
		//搜索
		$('.proRecordSousou').click(function(){
			ajaxpage(1);
		})
	})
</script>
</body>
 
</html>